home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWODUtil / Include / FWAcquir.h next >
Encoding:
Text File  |  1995-11-08  |  11.7 KB  |  368 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWAcquir.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWACQUIR_H
  11. #define FWACQUIR_H
  12.  
  13. #ifndef FWEXCDEF_H
  14. #include "FWExcDef.h"
  15. #endif
  16.  
  17. #ifndef FWAUTODE_H
  18. #include "FWAutoDe.h"
  19. #endif
  20.  
  21. #ifndef _ODTYPES_
  22. #include "ODTypes.h"
  23. #endif
  24.  
  25. #if FW_LIB_EXPORT_PRAGMAS
  26. #pragma lib_export on
  27. #endif
  28.  
  29. //========================================================================================
  30. // Forward Class Declarations
  31. //========================================================================================
  32.  
  33. class FW_CLASS_ATTR ODWindow;
  34. class FW_CLASS_ATTR ODFrame;
  35. class FW_CLASS_ATTR ODPart;
  36. class FW_CLASS_ATTR ODShape;
  37. class FW_CLASS_ATTR ODTransform;
  38. class FW_CLASS_ATTR ODStorageUnit;
  39. class FW_CLASS_ATTR ODStorageUnitView;
  40. class FW_CLASS_ATTR ODStorageUnitCursor;
  41. class FW_CLASS_ATTR ODMenuBar;
  42.  
  43. //========================================================================================
  44. // class FW_CAcquiredODWindow
  45. //========================================================================================
  46.  
  47. class FW_CLASS_ATTR FW_CAcquiredODWindow FW_AUTO_DESTRUCT_OBJECT
  48. {
  49. public:
  50.     FW_CAcquiredODWindow();
  51.     FW_CAcquiredODWindow(const FW_CAcquiredODWindow& other);
  52.     FW_CAcquiredODWindow(ODWindow* odWindow);
  53.     ~FW_CAcquiredODWindow();
  54.  
  55.     FW_CAcquiredODWindow& operator=(const FW_CAcquiredODWindow& other);
  56.     FW_CAcquiredODWindow& operator=(ODWindow* odWindow);
  57.  
  58.     FW_Boolean operator==(const FW_CAcquiredODWindow& other) const
  59.         {return fODWindow == other.fODWindow;}
  60.     FW_Boolean operator!=(const FW_CAcquiredODWindow& other) const
  61.         {return fODWindow != other.fODWindow;}
  62.  
  63.     FW_Boolean operator==(ODWindow* odWindow) const
  64.         {return fODWindow == odWindow;}
  65.     FW_Boolean operator!=(ODWindow* odWindow) const
  66.         {return fODWindow != odWindow;}
  67.  
  68.     operator ODWindow*() const
  69.         {return fODWindow;}        
  70.     operator const void*() const
  71.         {return fODWindow;}        
  72.     ODWindow* operator->() const
  73.         {return fODWindow;}
  74.  
  75. private:
  76.     ODWindow*            fODWindow;
  77. };
  78.  
  79. //========================================================================================
  80. // class FW_CAcquiredODStorageUnit
  81. //========================================================================================
  82.  
  83. class FW_CLASS_ATTR FW_CAcquiredODStorageUnit FW_AUTO_DESTRUCT_OBJECT
  84. {
  85. public:
  86.     FW_CAcquiredODStorageUnit();
  87.     FW_CAcquiredODStorageUnit(const FW_CAcquiredODStorageUnit& other);
  88.     FW_CAcquiredODStorageUnit(ODStorageUnit* storageUnit);
  89.     ~FW_CAcquiredODStorageUnit();
  90.  
  91.     FW_CAcquiredODStorageUnit& operator=(const FW_CAcquiredODStorageUnit& other);
  92.     FW_CAcquiredODStorageUnit& operator=(ODStorageUnit* storageUnit);
  93.  
  94.     FW_Boolean operator==(const FW_CAcquiredODStorageUnit& other) const
  95.         {return fODStorageUnit == other.fODStorageUnit;}
  96.     FW_Boolean operator!=(const FW_CAcquiredODStorageUnit& other) const
  97.         {return fODStorageUnit != other.fODStorageUnit;}
  98.  
  99.     FW_Boolean operator==(ODStorageUnit* storageUnit) const
  100.         {return fODStorageUnit == storageUnit;}
  101.     FW_Boolean operator!=(ODStorageUnit* storageUnit) const
  102.         {return fODStorageUnit != storageUnit;}
  103.  
  104.     operator ODStorageUnit*() const
  105.         {return fODStorageUnit;}        
  106.     operator const void*() const
  107.         {return fODStorageUnit;}        
  108.     ODStorageUnit* operator->() const
  109.         {return fODStorageUnit;}
  110.  
  111. private:
  112.     ODStorageUnit*        fODStorageUnit;
  113. };
  114.  
  115. //========================================================================================
  116. // class FW_CAcquiredODFrame
  117. //========================================================================================
  118.  
  119. class FW_CLASS_ATTR FW_CAcquiredODFrame FW_AUTO_DESTRUCT_OBJECT
  120. {
  121. public:
  122.     FW_CAcquiredODFrame();
  123.     FW_CAcquiredODFrame(const FW_CAcquiredODFrame& other);
  124.     FW_CAcquiredODFrame(ODFrame* odFrame);
  125.     ~FW_CAcquiredODFrame();
  126.  
  127.     FW_CAcquiredODFrame& operator=(const FW_CAcquiredODFrame& other);
  128.     FW_CAcquiredODFrame& operator=(ODFrame* odFrame);
  129.  
  130.     FW_Boolean operator==(const FW_CAcquiredODFrame& other) const
  131.         {return fODFrame == other.fODFrame;}
  132.     FW_Boolean operator!=(const FW_CAcquiredODFrame& other) const
  133.         {return fODFrame != other.fODFrame;}
  134.  
  135.     FW_Boolean operator==(ODFrame* odFrame) const
  136.         {return fODFrame == odFrame;}
  137.     FW_Boolean operator!=(ODFrame* odFrame) const
  138.         {return fODFrame != odFrame;}
  139.  
  140.     operator ODFrame*() const
  141.         {return fODFrame;}        
  142.     operator const void*() const
  143.         {return fODFrame;}        
  144.     ODFrame* operator->() const
  145.         {return fODFrame;}
  146.  
  147. private:
  148.     ODFrame*            fODFrame;
  149. };
  150.  
  151. //========================================================================================
  152. // class FW_CAcquiredODPart
  153. //========================================================================================
  154.  
  155. class FW_CLASS_ATTR FW_CAcquiredODPart FW_AUTO_DESTRUCT_OBJECT
  156. {
  157. public:
  158.     FW_CAcquiredODPart();
  159.     FW_CAcquiredODPart(const FW_CAcquiredODPart& other);
  160.     FW_CAcquiredODPart(ODPart* odPart);
  161.     ~FW_CAcquiredODPart();
  162.  
  163.     FW_CAcquiredODPart& operator=(const FW_CAcquiredODPart& other);
  164.     FW_CAcquiredODPart& operator=(ODPart* odPart);
  165.  
  166.     FW_Boolean operator==(const FW_CAcquiredODPart& other) const
  167.         {return fODPart == other.fODPart;}
  168.     FW_Boolean operator!=(const FW_CAcquiredODPart& other) const
  169.         {return fODPart != other.fODPart;}
  170.  
  171.     FW_Boolean operator==(ODPart* odPart) const
  172.         {return fODPart == odPart;}
  173.     FW_Boolean operator!=(ODPart* odPart) const
  174.         {return fODPart != odPart;}
  175.  
  176.     operator ODPart*() const
  177.         {return fODPart;}        
  178.     operator const void*() const
  179.         {return fODPart;}        
  180.     ODPart* operator->() const
  181.         {return fODPart;}
  182.         
  183. private:
  184.     ODPart*            fODPart;
  185. };
  186.  
  187. //========================================================================================
  188. // CLASS FW_CAcquiredODShape
  189. //========================================================================================
  190.  
  191. class FW_CLASS_ATTR FW_CAcquiredODShape FW_AUTO_DESTRUCT_OBJECT
  192. {
  193. public:
  194.     FW_CAcquiredODShape();
  195.     FW_CAcquiredODShape(const FW_CAcquiredODShape& other);
  196.     FW_CAcquiredODShape(ODShape* odShape);
  197.     ~FW_CAcquiredODShape();
  198.  
  199.     FW_CAcquiredODShape& operator=(const FW_CAcquiredODShape& other);
  200.     FW_CAcquiredODShape& operator=(ODShape* odShape);
  201.  
  202.     FW_Boolean operator==(const FW_CAcquiredODShape& other) const
  203.         {return fODShape == other.fODShape;}
  204.     FW_Boolean operator!=(const FW_CAcquiredODShape& other) const
  205.         {return fODShape != other.fODShape;}
  206.  
  207.     FW_Boolean operator==(ODShape* odShape) const
  208.         {return fODShape == odShape;}
  209.     FW_Boolean operator!=(ODShape* odShape) const
  210.         {return fODShape != odShape;}
  211.  
  212.     operator ODShape*() const
  213.         {return fODShape;}        
  214.     operator const void*() const
  215.         {return fODShape;}        
  216.     ODShape* operator->() const
  217.         {return fODShape;}
  218.  
  219. private:
  220.     ODShape*            fODShape;
  221. };
  222.  
  223. //========================================================================================
  224. // CLASS FW_CAcquiredODTransform
  225. //========================================================================================
  226.  
  227. class FW_CLASS_ATTR FW_CAcquiredODTransform FW_AUTO_DESTRUCT_OBJECT
  228. {
  229. public:
  230.     FW_CAcquiredODTransform();
  231.     FW_CAcquiredODTransform(const FW_CAcquiredODTransform& other);
  232.     FW_CAcquiredODTransform(ODTransform* odTransform);
  233.     ~FW_CAcquiredODTransform();
  234.  
  235.     FW_CAcquiredODTransform& operator=(const FW_CAcquiredODTransform& other);
  236.     FW_CAcquiredODTransform& operator=(ODTransform* odTransform);
  237.  
  238.     FW_Boolean operator==(const FW_CAcquiredODTransform& other) const
  239.         {return fODTransform == other.fODTransform;}
  240.     FW_Boolean operator!=(const FW_CAcquiredODTransform& other) const
  241.         {return fODTransform != other.fODTransform;}
  242.  
  243.     FW_Boolean operator==(ODTransform* odTransform) const
  244.         {return fODTransform == odTransform;}
  245.     FW_Boolean operator!=(ODTransform* odTransform) const
  246.         {return fODTransform != odTransform;}
  247.  
  248.     operator ODTransform*() const
  249.         {return fODTransform;}
  250.     operator const void*() const
  251.         {return fODTransform;}        
  252.     ODTransform* operator->() const
  253.         {return fODTransform;}
  254.     
  255. private:
  256.     ODTransform*        fODTransform;
  257. };
  258.  
  259. //========================================================================================
  260. // CLASS FW_CAcquiredODMenuBar
  261. //========================================================================================
  262.  
  263. class FW_CLASS_ATTR FW_CAcquiredODMenuBar FW_AUTO_DESTRUCT_OBJECT
  264. {
  265. public:
  266.     FW_CAcquiredODMenuBar();
  267.     FW_CAcquiredODMenuBar(const FW_CAcquiredODMenuBar& other);
  268.     FW_CAcquiredODMenuBar(ODMenuBar* odMenuBar);
  269.     ~FW_CAcquiredODMenuBar();
  270.  
  271.     FW_CAcquiredODMenuBar& operator=(const FW_CAcquiredODMenuBar& other);
  272.     FW_CAcquiredODMenuBar& operator=(ODMenuBar* odMenuBar);
  273.  
  274.     FW_Boolean operator==(const FW_CAcquiredODMenuBar& other) const
  275.         {return fODMenuBar == other.fODMenuBar;}
  276.     FW_Boolean operator!=(const FW_CAcquiredODMenuBar& other) const
  277.         {return fODMenuBar != other.fODMenuBar;}
  278.  
  279.     FW_Boolean operator==(ODMenuBar* odMenuBar) const
  280.         {return fODMenuBar == odMenuBar;}
  281.     FW_Boolean operator!=(ODMenuBar* odMenuBar) const
  282.         {return fODMenuBar != odMenuBar;}
  283.  
  284.     operator ODMenuBar*() const
  285.         {return fODMenuBar;}
  286.     operator const void*() const
  287.         {return fODMenuBar;}        
  288.     ODMenuBar* operator->() const
  289.         {return fODMenuBar;}
  290.     
  291. private:
  292.     ODMenuBar*        fODMenuBar;
  293. };
  294.  
  295. //========================================================================================
  296. // class FW_CAcquireODStorageUnitView
  297. //========================================================================================
  298.  
  299. class FW_CLASS_ATTR FW_CAcquireODStorageUnitView FW_AUTO_DESTRUCT_OBJECT
  300. {
  301. public:
  302.     FW_CAcquireODStorageUnitView(Environment* ev, 
  303.                                 ODStorageUnit* su, 
  304.                                 ODPropertyName propertyName, 
  305.                                 ODPositionCode propertyPosCode, 
  306.                                 ODValueType valueType, 
  307.                                 ODValueIndex valueIndex, 
  308.                                 ODPositionCode valuePosCode);            // Focus and create the storageView
  309.     FW_CAcquireODStorageUnitView(Environment* ev, ODStorageUnit* su);    // Suppose that already focused
  310.     ~FW_CAcquireODStorageUnitView();
  311.  
  312.     operator ODStorageUnitView*() const
  313.         {return fSUView;}
  314.     ODStorageUnitView* operator->() const
  315.         {return fSUView;}
  316.  
  317. private:
  318.     ODStorageUnitView*    fSUView;
  319. };
  320.  
  321. //========================================================================================
  322. // class FW_CAcquireODPropertyName
  323. //========================================================================================
  324.  
  325. class FW_CLASS_ATTR FW_CAcquireODPropertyName FW_AUTO_DESTRUCT_OBJECT
  326. {
  327. public:
  328.     FW_CAcquireODPropertyName(Environment* ev, ODStorageUnit* su);
  329.     FW_CAcquireODPropertyName(Environment* ev, ODStorageUnitView* suView);
  330.     FW_CAcquireODPropertyName(Environment* ev, ODStorageUnitCursor* suCursor);
  331.     ~FW_CAcquireODPropertyName();
  332.  
  333.     operator ODPropertyName() const
  334.         {return fPropName;}
  335.  
  336. private:
  337.     ODPropertyName    fPropName;
  338. };
  339.  
  340. //========================================================================================
  341. // FW_CopyAndRelease
  342. //========================================================================================
  343.  
  344. //########################################################################################
  345. // SCpp Hack
  346. // Work around SCpp 8.0.3 bug - importing overloaded functions doesn't work.
  347. // Replace overloaded functions with normal functions with different names.
  348. // Use inline overloaded functions which turn around and call the renamed
  349. // functions so client code isn't affected.
  350. //########################################################################################
  351.  
  352. FW_FUNC_ATTR ODShape*        FW_CopyAndRelease_Shape(Environment* ev, ODShape* shapeToCopy);
  353. FW_FUNC_ATTR ODTransform*     FW_CopyAndRelease_Transform(Environment* ev, ODTransform* transformToCopy);
  354.  
  355. #if FW_LIB_EXPORT_PRAGMAS
  356. #pragma lib_export off
  357. #endif
  358.  
  359. inline ODShape*        FW_CopyAndRelease (Environment* ev, ODShape* shapeToCopy) {
  360.     return FW_CopyAndRelease_Shape (ev, shapeToCopy);
  361. }
  362.  
  363. inline ODTransform* FW_CopyAndRelease (Environment* ev, ODTransform* transformToCopy) {
  364.     return FW_CopyAndRelease_Transform (ev, transformToCopy);
  365. }
  366.  
  367. #endif
  368.